<?php
use \Workerman\Autoloader;

require_once __DIR__ . '/../../../../../Workerman/Autoloader.php';
require_once __DIR__.'/../../../Config/Const.php';
Autoloader::setRootPath(__DIR__.'/../../..');

$page_groupId = GROUP_FINANCE_MNG;
$page_pageId = PAGE_MANAGER_BALANCE_FLOW;

require "../framepages/moudle_base.php";


$date = $_POST['date'];
if (!$date) {
    $date = date('Y-m-d');
}

?>

<script type="text/javascript" src="../../src/js/My97DatePicker/WdatePicker.js"> </script>

<div class="main-content">
    <div>

            <table width="100%">
                <form method="post" action="">
                <tr>
                    <th width="13%">日期 &nbsp;<input type="text" name="date" id="date" size="10" onClick="WdatePicker()" readonly="readonly" value="<?php echo $date ?>"></th>
                    <th width="13%">流水金额</th>
                    <th width="13%">流水类型</th>
                    <th width="13%">商铺id</th>
                    <th>余额</th>
                    <th><input type="submit" class="btn btn-danger" value="查询"></th>
                </tr>

                </form>
                <?php
                    $manage_balance_flow_list = \Data\Manager_balance_DAO::getList($date);
                    foreach ($manage_balance_flow_list as $manage_balance_flow_record) {
                        $date = $manage_balance_flow_record->getDATE();
                        $balance_flow = $manage_balance_flow_record->getBALANCE_FLOW();
                        $flow_type = $manage_balance_flow_record->getFLOW_TYPE();
                        $restaurant_id = $manage_balance_flow_record->getRESTAURANT_ID();
                        $balance = $manage_balance_flow_record->getBALANCE();

                        echo "
                            <td>$date</td>
                            <td>$balance_flow</td>
                            <td>$flow_type</td>
                            <td>$restaurant_id</td>
                            <td>$balance</td>
                        ";

                    }
                ?>
            </table>

    </div>
    <?php
    require "../framepages/footer.php";
    ?>
</div>
</div>
<script src="../lib/bootstrap/js/bootstrap.js"></script>
</body>
</html>